#include "DetourCommon.h"
#ifdef __cplusplus
extern "C" {
#endif
int nav_dtAlign4(int x){
	int c_arg_x=x;
	int c_out = dtAlign4(c_arg_x);
	int wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtCalcPolyCenter(float * tc,unsigned short const * idx,int nidx,float const * verts){
	float * c_arg_tc=(float *)(void*)(tc);
	unsigned short const * c_arg_idx=(unsigned short const *)(void*)(idx);
	int c_arg_nidx=nidx;
	float const * c_arg_verts=(float const *)(void*)(verts);
	dtCalcPolyCenter(c_arg_tc,c_arg_idx,c_arg_nidx,c_arg_verts);
}

bool nav_dtClosestHeightPointTriangle(float const * tmp_arg_p,float const * a,float const * b,float const * c,float * h){
	float const * c_arg_tmp_arg_p=(float const *)(void*)(tmp_arg_p);
	float const * c_arg_a=(float const *)(void*)(a);
	float const * c_arg_b=(float const *)(void*)(b);
	float const * c_arg_c=(float const *)(void*)(c);
	float& c_arg_h=*(float *)(h);
	bool c_out = dtClosestHeightPointTriangle(c_arg_tmp_arg_p,c_arg_a,c_arg_b,c_arg_c,c_arg_h);
	bool wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtClosestPtPointTriangle(float * closest,float const * tmp_arg_p,float const * a,float const * b,float const * c){
	float * c_arg_closest=(float *)(void*)(closest);
	float const * c_arg_tmp_arg_p=(float const *)(void*)(tmp_arg_p);
	float const * c_arg_a=(float const *)(void*)(a);
	float const * c_arg_b=(float const *)(void*)(b);
	float const * c_arg_c=(float const *)(void*)(c);
	dtClosestPtPointTriangle(c_arg_closest,c_arg_tmp_arg_p,c_arg_a,c_arg_b,c_arg_c);
}

bool nav_dtDistancePtPolyEdgesSqr(float const * pt,float const * verts,int const nverts,float * ed,float * et){
	float const * c_arg_pt=(float const *)(void*)(pt);
	float const * c_arg_verts=(float const *)(void*)(verts);
	int const c_arg_nverts=nverts;
	float * c_arg_ed=(float *)(void*)(ed);
	float * c_arg_et=(float *)(void*)(et);
	bool c_out = dtDistancePtPolyEdgesSqr(c_arg_pt,c_arg_verts,c_arg_nverts,c_arg_ed,c_arg_et);
	bool wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtDistancePtSegSqr2D(float const * pt,float const * tmp_arg_p,float const * q,float * t){
	float const * c_arg_pt=(float const *)(void*)(pt);
	float const * c_arg_tmp_arg_p=(float const *)(void*)(tmp_arg_p);
	float const * c_arg_q=(float const *)(void*)(q);
	float& c_arg_t=*(float *)(t);
	float c_out = dtDistancePtSegSqr2D(c_arg_pt,c_arg_tmp_arg_p,c_arg_q,c_arg_t);
	float wrap_out  = (c_out);
	return wrap_out;
}

unsigned int nav_dtIlog2(unsigned int v){
	unsigned int c_arg_v=v;
	unsigned int c_out = dtIlog2(c_arg_v);
	unsigned int wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtIntersectSegmentPoly2D(float const * p0,float const * p1,float const * verts,int nverts,float * tmin,float * tmax,int * segMin,int * segMax){
	float const * c_arg_p0=(float const *)(void*)(p0);
	float const * c_arg_p1=(float const *)(void*)(p1);
	float const * c_arg_verts=(float const *)(void*)(verts);
	int c_arg_nverts=nverts;
	float& c_arg_tmin=*(float *)(tmin);
	float& c_arg_tmax=*(float *)(tmax);
	int& c_arg_segMin=*(int *)(segMin);
	int& c_arg_segMax=*(int *)(segMax);
	bool c_out = dtIntersectSegmentPoly2D(c_arg_p0,c_arg_p1,c_arg_verts,c_arg_nverts,c_arg_tmin,c_arg_tmax,c_arg_segMin,c_arg_segMax);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtIntersectSegSeg2D(float const * ap,float const * aq,float const * bp,float const * bq,float * s,float * t){
	float const * c_arg_ap=(float const *)(void*)(ap);
	float const * c_arg_aq=(float const *)(void*)(aq);
	float const * c_arg_bp=(float const *)(void*)(bp);
	float const * c_arg_bq=(float const *)(void*)(bq);
	float& c_arg_s=*(float *)(s);
	float& c_arg_t=*(float *)(t);
	bool c_out = dtIntersectSegSeg2D(c_arg_ap,c_arg_aq,c_arg_bp,c_arg_bq,c_arg_s,c_arg_t);
	bool wrap_out  = (c_out);
	return wrap_out;
}

unsigned int nav_dtNextPow2(unsigned int v){
	unsigned int c_arg_v=v;
	unsigned int c_out = dtNextPow2(c_arg_v);
	unsigned int wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtOppositeTile(int side){
	int c_arg_side=side;
	int c_out = dtOppositeTile(c_arg_side);
	int wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtOverlapBounds(float const * amin,float const * amax,float const * bmin,float const * bmax){
	float const * c_arg_amin=(float const *)(void*)(amin);
	float const * c_arg_amax=(float const *)(void*)(amax);
	float const * c_arg_bmin=(float const *)(void*)(bmin);
	float const * c_arg_bmax=(float const *)(void*)(bmax);
	bool c_out = dtOverlapBounds(c_arg_amin,c_arg_amax,c_arg_bmin,c_arg_bmax);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtOverlapPolyPoly2D(float const * polya,int const npolya,float const * polyb,int const npolyb){
	float const * c_arg_polya=(float const *)(void*)(polya);
	int const c_arg_npolya=npolya;
	float const * c_arg_polyb=(float const *)(void*)(polyb);
	int const c_arg_npolyb=npolyb;
	bool c_out = dtOverlapPolyPoly2D(c_arg_polya,c_arg_npolya,c_arg_polyb,c_arg_npolyb);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtOverlapQuantBounds(unsigned short const(*amin)[3],unsigned short const(*amax)[3],unsigned short const(*bmin)[3],unsigned short const(*bmax)[3]){
	unsigned short(&c_arg_amin)[3]=*(unsigned short(*)[3])(void*)(amin);
	unsigned short(&c_arg_amax)[3]=*(unsigned short(*)[3])(void*)(amax);
	unsigned short(&c_arg_bmin)[3]=*(unsigned short(*)[3])(void*)(bmin);
	unsigned short(&c_arg_bmax)[3]=*(unsigned short(*)[3])(void*)(bmax);
	bool c_out = dtOverlapQuantBounds(c_arg_amin,c_arg_amax,c_arg_bmin,c_arg_bmax);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPointInPolygon(float const * pt,float const * verts,int const nverts){
	float const * c_arg_pt=(float const *)(void*)(pt);
	float const * c_arg_verts=(float const *)(void*)(verts);
	int const c_arg_nverts=nverts;
	bool c_out = dtPointInPolygon(c_arg_pt,c_arg_verts,c_arg_nverts);
	bool wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtRandomPointInConvexPoly(float const * pts,int const npts,float * areas,float const s,float const t,float * out){
	float const * c_arg_pts=(float const *)(void*)(pts);
	int const c_arg_npts=npts;
	float * c_arg_areas=(float *)(void*)(areas);
	float const c_arg_s=s;
	float const c_arg_t=t;
	float * c_arg_out=(float *)(void*)(out);
	dtRandomPointInConvexPoly(c_arg_pts,c_arg_npts,c_arg_areas,c_arg_s,c_arg_t,c_arg_out);
}

void nav_dtSwapByte(unsigned char * a,unsigned char * b){
	unsigned char * c_arg_a=(unsigned char *)(void*)(a);
	unsigned char * c_arg_b=(unsigned char *)(void*)(b);
	dtSwapByte(c_arg_a,c_arg_b);
}

void nav_dtSwapEndian(unsigned short * v){
	unsigned short * c_arg_v=(unsigned short *)(void*)(v);
	dtSwapEndian(c_arg_v);
}

void nav_dtSwapEndian11(short * v){
	short * c_arg_v=(short *)(void*)(v);
	dtSwapEndian(c_arg_v);
}

void nav_dtSwapEndian12(unsigned int * v){
	unsigned int * c_arg_v=(unsigned int *)(void*)(v);
	dtSwapEndian(c_arg_v);
}

void nav_dtSwapEndian13(int * v){
	int * c_arg_v=(int *)(void*)(v);
	dtSwapEndian(c_arg_v);
}

void nav_dtSwapEndian14(float * v){
	float * c_arg_v=(float *)(void*)(v);
	dtSwapEndian(c_arg_v);
}

float nav_dtTriArea2D(float const * a,float const * b,float const * c){
	float const * c_arg_a=(float const *)(void*)(a);
	float const * c_arg_b=(float const *)(void*)(b);
	float const * c_arg_c=(float const *)(void*)(c);
	float c_out = dtTriArea2D(c_arg_a,c_arg_b,c_arg_c);
	float wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtVadd(float * dest,float const * v1,float const * v2){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	dtVadd(c_arg_dest,c_arg_v1,c_arg_v2);
}

void nav_dtVcopy(float * dest,float const * a){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_a=(float const *)(void*)(a);
	dtVcopy(c_arg_dest,c_arg_a);
}

void nav_dtVcross(float * dest,float const * v1,float const * v2){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	dtVcross(c_arg_dest,c_arg_v1,c_arg_v2);
}

float nav_dtVdist(float const * v1,float const * v2){
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float c_out = dtVdist(c_arg_v1,c_arg_v2);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVdist2D(float const * v1,float const * v2){
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float c_out = dtVdist2D(c_arg_v1,c_arg_v2);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVdist2DSqr(float const * v1,float const * v2){
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float c_out = dtVdist2DSqr(c_arg_v1,c_arg_v2);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVdistSqr(float const * v1,float const * v2){
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float c_out = dtVdistSqr(c_arg_v1,c_arg_v2);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVdot(float const * v1,float const * v2){
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float c_out = dtVdot(c_arg_v1,c_arg_v2);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVdot2D(float const * u,float const * v){
	float const * c_arg_u=(float const *)(void*)(u);
	float const * c_arg_v=(float const *)(void*)(v);
	float c_out = dtVdot2D(c_arg_u,c_arg_v);
	float wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtVequal(float const * p0,float const * p1){
	float const * c_arg_p0=(float const *)(void*)(p0);
	float const * c_arg_p1=(float const *)(void*)(p1);
	bool c_out = dtVequal(c_arg_p0,c_arg_p1);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtVisfinite(float const * v){
	float const * c_arg_v=(float const *)(void*)(v);
	bool c_out = dtVisfinite(c_arg_v);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtVisfinite2D(float const * v){
	float const * c_arg_v=(float const *)(void*)(v);
	bool c_out = dtVisfinite2D(c_arg_v);
	bool wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVlen(float const * v){
	float const * c_arg_v=(float const *)(void*)(v);
	float c_out = dtVlen(c_arg_v);
	float wrap_out  = (c_out);
	return wrap_out;
}

float nav_dtVlenSqr(float const * v){
	float const * c_arg_v=(float const *)(void*)(v);
	float c_out = dtVlenSqr(c_arg_v);
	float wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtVlerp(float * dest,float const * v1,float const * v2,float const t){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float const c_arg_t=t;
	dtVlerp(c_arg_dest,c_arg_v1,c_arg_v2,c_arg_t);
}

void nav_dtVmad(float * dest,float const * v1,float const * v2,float const s){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	float const c_arg_s=s;
	dtVmad(c_arg_dest,c_arg_v1,c_arg_v2,c_arg_s);
}

void nav_dtVmax(float * mx,float const * v){
	float * c_arg_mx=(float *)(void*)(mx);
	float const * c_arg_v=(float const *)(void*)(v);
	dtVmax(c_arg_mx,c_arg_v);
}

void nav_dtVmin(float * mn,float const * v){
	float * c_arg_mn=(float *)(void*)(mn);
	float const * c_arg_v=(float const *)(void*)(v);
	dtVmin(c_arg_mn,c_arg_v);
}

void nav_dtVnormalize(float * v){
	float * c_arg_v=(float *)(void*)(v);
	dtVnormalize(c_arg_v);
}

float nav_dtVperp2D(float const * u,float const * v){
	float const * c_arg_u=(float const *)(void*)(u);
	float const * c_arg_v=(float const *)(void*)(v);
	float c_out = dtVperp2D(c_arg_u,c_arg_v);
	float wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtVscale(float * dest,float const * v,float const t){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v=(float const *)(void*)(v);
	float const c_arg_t=t;
	dtVscale(c_arg_dest,c_arg_v,c_arg_t);
}

void nav_dtVset(float * dest,float const x,float const y,float const z){
	float * c_arg_dest=(float *)(void*)(dest);
	float const c_arg_x=x;
	float const c_arg_y=y;
	float const c_arg_z=z;
	dtVset(c_arg_dest,c_arg_x,c_arg_y,c_arg_z);
}

void nav_dtVsub(float * dest,float const * v1,float const * v2){
	float * c_arg_dest=(float *)(void*)(dest);
	float const * c_arg_v1=(float const *)(void*)(v1);
	float const * c_arg_v2=(float const *)(void*)(v2);
	dtVsub(c_arg_dest,c_arg_v1,c_arg_v2);
}

#ifdef __cplusplus
}
#endif
